# -*- Mode: Makefile -*-
#
# Makefile.am - automake file for Raptor docs
#
# Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/
# Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/
# 
# This package is Free Software and part of Redland http://librdf.org/
# 
# It is licensed under the following three licenses as alternatives:
#   1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
#   2. GNU General Public License (GPL) V2 or any newer version
#   3. Apache License, V2.0 or any newer version
# 
# You may not use this file except in compliance with at least one of
# the above three licenses.
# 
# See LICENSE.html or LICENSE.txt at the top of this package for the
# complete terms and further detail along with the license texts for
# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
# 
# 


# The name of the module.
DOC_MODULE=raptor2

# The top-level SGML file.
DOC_MAIN_SGML_FILE=raptor-docs.xml

# Extra options to supply to gtkdoc-scan
SCAN_OPTIONS= --deprecated-guards="RAPTOR_DISABLE_DEPRECATED"

# The directory containing the source code. Relative to $(srcdir)
DOC_SOURCE_DIR=../src

# Used for dependencies
HFILE_GLOB=$(builddir)/raptor-fake.h
CFILE_GLOB=$(top_srcdir)/src/raptor_*.c

IGNORE_CFILES= \
n3_lexer.c \
n3_parser.c \
raptor_nfc_test.c \
raptor_rss_common.c \
raptor_xsd.c \
turtle_lexer.c \
turtle_parser.c \
turtle_common.c \
parsedate.c \
strcasecmp.c

# Use fixed version of raptor2.h
EXTRA_HFILES=$(builddir)/raptor-fake.h

# Headers to ignore: yes raptor2.h is intended to be in this list
# since it is added as a fixed file raptor-fake.h by EXTRA_HFILES above
IGNORE_HFILES= \
	n3_common.h \
	n3_lexer.h \
	n3_parser.h \
	parsedate.h \
	raptor.h \
	raptor2.h \
	raptor_config.h \
	raptor_internal.h \
	raptor_nfc.h \
	raptor_rss.h \
	turtle_common.h \
	turtle_lexer.h \
	turtle_parser.h \
	git-version.h

# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
AM_CPPFLAGS =
GTKDOC_LIBS =

# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=--sgml-mode --output-format=xml --ignore-files="$(IGNORE_CFILES)"

# Extra options to supply to gtkdoc-mktmpl
MKTMPL_OPTIONS=

# Non-autogenerated (XML, other) files to be included in $(DOC_MAIN_SGML_FILE)
content_files = \
	raptor-changes.xml \
	raptor-formats.xml \
	raptor-parsers.xml \
	raptor-serializers.xml \
	raptor-tutorial-intro.xml \
	raptor-tutorial-querying-functionality.xml \
	raptor-tutorial-parsing.xml \
	raptor-tutorial-serializing.xml \
	version.xml \
	rdfprint.c \
	rdfcat.c \
	rdfserialize.c

# Images to copy into HTML directory
HTML_IMAGES =

# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=

# gtkdoc might not define this
DISTCLEANFILES=

include $(top_srcdir)/gtk-doc.make

man_MANS = libraptor2.3

EXTRA_DIST+= \
libraptor2.html \
raptor1-eol.html \
$(man_MANS) \
version.xml.in \
upgrade-script.pl \
raptor-changes.tsv

DISTCLEANFILES+= \
raptor-fake.h

raptor-fake.h: $(top_builddir)/src/raptor2.h $(top_srcdir)/scripts/fix-gtkdoc-header.pl
	$(PERL) $(top_srcdir)/scripts/fix-gtkdoc-header.pl < $< > $@

if MAINTAINER_MODE
libraptor2.html: $(srcdir)/libraptor2.3 $(top_srcdir)/scripts/fix-groff-xhtml.pl
	-groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(top_srcdir)/scripts/fix-groff-xhtml.pl $@

rdfcat.c: $(top_srcdir)/examples/rdfcat.c
	$(install_sh_DATA) $? $@

rdfprint.c: $(top_srcdir)/examples/rdfprint.c
	$(install_sh_DATA) $? $@

rdfserialize.c: $(top_srcdir)/examples/rdfserialize.c
	$(install_sh_DATA) $? $@

raptor-tutorial-parsing.xml: rdfcat.c

raptor-tutorial-serializing.xml: rdfprint.c rdfserialize.c

raptor-changes.xml: $(srcdir)/raptor-changes.tsv $(top_srcdir)/scripts/process-changes.pl
	$(PERL) $(top_srcdir)/scripts/process-changes.pl --docbook-xml $@ $(PACKAGE) $(srcdir)/raptor-changes.tsv

raptor-formats.xml: $(top_builddir)/scripts/build-formats$(EXEEXT)
	$(top_builddir)/scripts/build-formats$(EXEEXT) > $@

$(top_builddir)/scripts/build-formats$(EXEEXT):
	cd $(top_builddir)/scripts && $(MAKE) build-formats$(EXEEXT)

upgrade-script.pl: $(top_srcdir)/scripts/process-changes.pl $(srcdir)/raptor-changes.tsv
	$(PERL) $(top_srcdir)/scripts/process-changes.pl --upgrade-script $@ $(PACKAGE) $(srcdir)/raptor-changes.tsv

endif

dist-hook-local: docs
